import { request } from 'umi';

export interface IuserInfo{
    name:string,
    password:string
}

export interface IuserObj {
    payload: IuserInfo
}

export interface IComment {
  hostId: string;
  name: string;
  email: string;
  content: string;
  url: string;
}
export interface ICommentType {
  payload:IComment
}

// 获取文章评论
export function getArticleCommend(articleId:string,page=1){
  return request(`/api/comment/host/${articleId}`,{
    method:'GET',
    params:{
      page,
      pageSize:6
    }
  })
}

// 提交评论
export function addCommend(payload:ICommentType){
  return request('/api/comment',{
    method: 'POST',
    data:payload
  })

}